import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

//定义数据
let state = {
   msg:""
};

//mutations里面定义方法，改变state中的数据
let mutations = {
  setMsg(state,msg){
     state.msg = msg;
  }
};

//实例化Vuex.store
const store = new Vuex.Store({
  state,
  mutations
});

export default store;
